\subsection{i2c.c-Dateireferenz}
\label{i2c_8c}\index{i2c.c@{i2c.c}}
{\tt \#include \char`\"{}i2c-dev.h\char`\"{}}\par
{\tt \#include \char`\"{}i2c.h\char`\"{}}\par
{\tt \#include \char`\"{}log.h\char`\"{}}\par
{\tt \#include $<$string.h$>$}\par
{\tt \#include $<$stdlib.h$>$}\par
{\tt \#include $<$sys/types.h$>$}\par
{\tt \#include $<$sys/stat.h$>$}\par
{\tt \#include $<$sys/poll.h$>$}\par
{\tt \#include $<$stdio.h$>$}\par
{\tt \#include $<$fcntl.h$>$}\par
{\tt \#include $<$unistd.h$>$}\par
{\tt \#include $<$sys/ioctl.h$>$}\par
\subsubsection*{Makrodefinitionen}
\begin{CompactItemize}
\item 
\#define {\bf I2C\_\-SLAVE\_\-ADDR}~0x38
\end{CompactItemize}
\subsubsection*{Funktionen}
\begin{CompactItemize}
\item 
int {\bf lcv\_\-i2c\_\-write\_\-register} (char $\ast$device, unsigned char client, unsigned char reg, unsigned short value)
\begin{CompactList}\small\item\em Lies ein Register über einen I2C-Bus. \item\end{CompactList}\item 
int {\bf lcv\_\-i2c\_\-read\_\-register} (char $\ast$device, unsigned char client, unsigned char reg)
\begin{CompactList}\small\item\em Schreibt ein Register über einen I2C-Bus. \item\end{CompactList}\item 
void {\bf lcv\_\-i2c\_\-dump\_\-register} (char $\ast$device, unsigned char client, unsigned short start, unsigned short end)
\begin{CompactList}\small\item\em Erstellt einen Dump eines Clients über einen I2C-Bus. \item\end{CompactList}\item 
void {\bf lcv\_\-i2c\_\-scan\_\-bus} (char $\ast$device)
\begin{CompactList}\small\item\em Scannt den I2C-Bus. \item\end{CompactList}\end{CompactItemize}


\subsubsection{Makro-Dokumentation}
\index{i2c.c@{i2c.c}!I2C_SLAVE_ADDR@{I2C\_\-SLAVE\_\-ADDR}}
\index{I2C_SLAVE_ADDR@{I2C\_\-SLAVE\_\-ADDR}!i2c.c@{i2c.c}}
\paragraph{\setlength{\rightskip}{0pt plus 5cm}\#define I2C\_\-SLAVE\_\-ADDR~0x38}\hfill\label{i2c_8c_649ca8c7e017db38d09d4834dfccd361}




Definiert in Zeile 50 der Datei i2c.c.

Wird benutzt von lcv\_\-i2c\_\-dump\_\-register(), lcv\_\-i2c\_\-read\_\-register(), lcv\_\-i2c\_\-scan\_\-bus() und lcv\_\-i2c\_\-write\_\-register().

\subsubsection{Dokumentation der Funktionen}
\index{i2c.c@{i2c.c}!lcv_i2c_dump_register@{lcv\_\-i2c\_\-dump\_\-register}}
\index{lcv_i2c_dump_register@{lcv\_\-i2c\_\-dump\_\-register}!i2c.c@{i2c.c}}
\paragraph{\setlength{\rightskip}{0pt plus 5cm}void lcv\_\-i2c\_\-dump\_\-register (char $\ast$ {\em device}, unsigned char {\em client}, unsigned short {\em start}, unsigned short {\em end})}\hfill\label{i2c_8c_d24ed091971ab74561f0180091122aa1}


Erstellt einen Dump eines Clients über einen I2C-Bus. 

\begin{Desc}
\item[Parameter:]
\begin{description}
\item[{\em device}]Device \item[{\em client}]Client \item[{\em start}]Startadresse \item[{\em end}]Endadresse \end{description}
\end{Desc}


Definiert in Zeile 151 der Datei i2c.c.\index{i2c.c@{i2c.c}!lcv_i2c_read_register@{lcv\_\-i2c\_\-read\_\-register}}
\index{lcv_i2c_read_register@{lcv\_\-i2c\_\-read\_\-register}!i2c.c@{i2c.c}}
\paragraph{\setlength{\rightskip}{0pt plus 5cm}int lcv\_\-i2c\_\-read\_\-register (char $\ast$ {\em device}, unsigned char {\em client}, unsigned char {\em reg})}\hfill\label{i2c_8c_2b821832a74e3197fecba3661422cd27}


Schreibt ein Register über einen I2C-Bus. 

\begin{Desc}
\item[Parameter:]
\begin{description}
\item[{\em device}]Device \item[{\em client}]Client \item[{\em reg}]Register \end{description}
\end{Desc}
\begin{Desc}
\item[Rückgabe:]Registerwert \end{Desc}


Definiert in Zeile 96 der Datei i2c.c.

Wird benutzt von lcv\_\-config\_\-read().\index{i2c.c@{i2c.c}!lcv_i2c_scan_bus@{lcv\_\-i2c\_\-scan\_\-bus}}
\index{lcv_i2c_scan_bus@{lcv\_\-i2c\_\-scan\_\-bus}!i2c.c@{i2c.c}}
\paragraph{\setlength{\rightskip}{0pt plus 5cm}void lcv\_\-i2c\_\-scan\_\-bus (char $\ast$ {\em device})}\hfill\label{i2c_8c_fefa8202689ea920247d64e005ac5fca}


Scannt den I2C-Bus. 

\begin{Desc}
\item[Parameter:]
\begin{description}
\item[{\em device}]Device \end{description}
\end{Desc}


Definiert in Zeile 211 der Datei i2c.c.\index{i2c.c@{i2c.c}!lcv_i2c_write_register@{lcv\_\-i2c\_\-write\_\-register}}
\index{lcv_i2c_write_register@{lcv\_\-i2c\_\-write\_\-register}!i2c.c@{i2c.c}}
\paragraph{\setlength{\rightskip}{0pt plus 5cm}int lcv\_\-i2c\_\-write\_\-register (char $\ast$ {\em device}, unsigned char {\em client}, unsigned char {\em reg}, unsigned short {\em value})}\hfill\label{i2c_8c_aefacaff83104e4b19526ea1af6f7da5}


Lies ein Register über einen I2C-Bus. 

\begin{Desc}
\item[Parameter:]
\begin{description}
\item[{\em device}]Device \item[{\em client}]Client \item[{\em reg}]Register \item[{\em value}]Wert \end{description}
\end{Desc}
\begin{Desc}
\item[Rückgabe:]Null wenn erfolgreich beendet \end{Desc}


Definiert in Zeile 53 der Datei i2c.c.

Wird benutzt von lcv\_\-config\_\-write().